from chatbot.bot.engine import ChatBot
from chatbot.bot.logic.logic_adapter import LogicAdapter
from chatbot.models import SimilarQuestion, Knowledge
from chatbot.service.logic.ir.search_engine import get_result_from_search_engine


class WeatherLogicAdapter(LogicAdapter):
    def __init__(self, chatbot: ChatBot, **kwargs):
        super().__init__(chatbot, **kwargs)

    def can_process(self, question):
        return True

    def process(self, question, additional_response_selection_parameters=None):
        return get_result_from_search_engine(question, (Knowledge, SimilarQuestion))
